package com.huabo.contract.mysql.mapper;

import com.huabo.contract.mysql.entity.TblInvestmentProjectMySql;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.BaseMapper;

public interface TblInvestmentProjectMySqlMapper extends BaseMapper<TblInvestmentProjectMySql> {

    @Insert("INSERT INTO TBL_INVESTMENT_PROJECT(PROJECTID,PROJECTNO,PROJECTNAME) VALUES(#{id},#{no},#{name})")
    void insertTblInvestmentProject(@Param("id") String id, @Param("no") String no, @Param("name") String name);

    @Update("UPDATE TBL_INVESTMENT_PROJECT SET PROJECTNO = #{no} ,PROJECTNAME = #{name} WHERE PROJECTID = #{id}")
    void updateTblInvestmentProject(@Param("id") String id, @Param("no") String no, @Param("name") String name) throws Exception;

    @Select("SELECT COUNT(*) FROM TBL_INVESTMENT_PROJECT WHERE PROJECTID=#{id}")
    Integer selectTblInvestmentProject(@Param("id") String id) throws Exception;

}
